<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>doh.robot Tooltip Mouse Test</title>

		<style>
			@import "../../../util/doh/robot/robot.css";
		</style>

		<!-- required: dojo.js -->
		<script type="text/javascript" src="../../../dojo/dojo.js"
			djConfig="isDebug: true"></script>

		<!-- functions to help test -->
		<script type="text/javascript" src="../helpers.js"></script>

		<script type="text/javascript">
			dojo.require("dijit.robotx");

			dojo.addOnLoad(function(){
				doh.robot.initRobot('../test_Tooltip.html');

				// Pointer to master tooltip.  This gets set in the first test when the
				// first tooltip is shown
				var masterTT;

				doh.register("dijit.Tooltip mouse tests", [
					{
						name: "show on mouse over",
						timeout: 4000,
						runTest: function(){
							var d = new doh.Deferred(),
								around = dojo.byId("four");

							doh.robot.mouseMoveAt("four", 500);

							doh.robot.sequence(d.getTestCallback(function(){
								// At this point the master tooltip should have been created, so save in
								// global variable
								masterTT = dojo.global.dijit._masterTT;

								doh.t(masterTT && isVisible(masterTT.domNode), "tooltip shown");
							}), 2000);

							return d;
						}
					},

					{
						name: "hide on defocus",
						timeout: 4000,
						runTest: function(){
							var d = new doh.Deferred();

							// Tab off of the "button w/tooltip" to the "remove button",
							// which doesn't have a tooltip
							doh.robot.mouseMoveAt(dojo.query("h1")[0], 500);

							doh.robot.sequence(d.getTestCallback(function(){
								doh.t(masterTT && isHidden(masterTT.domNode), "tooltip hidden");
							}), 2000);

							return d;
						}
					}
				]);

				doh.run();
			});
		</script>
	</head>
</html>
